﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccess;
namespace SQT.tracnghiem.Ajax.ASP.Lesson
{
    public partial class edit_lesson_form : System.Web.UI.Page
    {
        public int lesson;
        public string name;
        protected void Page_Load(object sender, EventArgs e)
        {
            lesson = int.Parse(Request.QueryString["id"]);
            var get_lesson = new TblLessonController().FetchAll().Where(x => x.LessonId == lesson).Single();
            name = get_lesson.LessonTitle;
        }

        public bool checkNumberFromArray(string s, int x)
        {
            int role_length = s.Split(',').Length;
            string[] split = new string[role_length];
            split = s.Split(',');

            for (int i = 0; i < role_length; i++)
            {
                if (int.Parse(split[i]) == x)
                    return true;
            }
            return false;
        }
    }
}